﻿using ServerListerner.Connections;

using System;
using System.Collections.Generic;
using System.Net;
using System.Security.Cryptography;
using System.Text;

namespace ServerListerner
{
    public interface ITCPConnection:IDisposable
    {
        Action<ITCPConnection> OnConnection { get; set; }
        Action<ITCPConnection, byte[]> OnReceived { get; set; }
        Action<ITCPConnection> OnClosed { get; set; }
        Action<ITCPConnection, string, Exception> OnError { get; set; }
        Guid? ConnectionId { get;  }
        EndPoint? RemoteEndPoint { get; }
        void Send(byte[] data);
        void Send(string _str, Encoding encoding = null);
    }
}
